﻿using BaseAuthRole.AspNetCore.Filters;
using log4net;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RS.BaseModel.Common;
using TPWorkPlat.DTO.Input;
using TPWorkPlat.Entity;
using TPWorkPlat.IService;

namespace TPWorkPlat.Server.Api
{
    /// <summary>
    /// 首页相关接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HomeController : ControllerBase
    {
        private ITheoryStudyService _theoryStudyService;

        private ILog logger = log4net.LogManager.GetLogger("HomeController");
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="theoryStudyService"></param>
        public HomeController(ITheoryStudyService theoryStudyService) {

            _theoryStudyService = theoryStudyService;
        }

        /// <summary>
        /// 获取首页理论学习动态列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetHomeList([FromQuery]TheoryStudyHomeInput theoryStudyHomeInput)
        {
            var r = _theoryStudyService.GetHomeList(theoryStudyHomeInput);

            return Ok(r);
        }

    }
}
